package Test.FOURTH.TWO;

import java.util.Calendar;
import java.util.GregorianCalendar;

public class Times {
    public static void main(String[] args) {
        timeclock timeclock1=new timeclock("One",12,23,43);
        timeclock timeclock2=new timeclock("Two",6,34,12);
        timeclock timeclock3=new timeclock("Three",18,9,3);
        timeclock1.start();
        timeclock2.start();
        timeclock3.start();
    }
}

class timeclock extends Thread{
    String name;
    GregorianCalendar calendar=new GregorianCalendar();

    timeclock(String name,int hour,int minute,int second){
        this.name=name;
        calendar.set(Calendar.YEAR,Calendar.MONTH,Calendar.DATE,hour,minute,second);
    }

    @Override
    public void run() {
        System.out.println("---时钟---" + name +":\t"+ calendar.get(Calendar.HOUR) + ":" +
                calendar.get(Calendar.MINUTE) + ":" + calendar.get(Calendar.SECOND));

    }
}
